﻿<%@ Page Language="C#" AutoEventWireup="True" CodeBehind="PropertyManagement.aspx.cs" Inherits="Medianamik.UI.TypeManagement.PropertyManagement" MasterPageFile="/Medianamik/MasterPages/MedianamikModule.Master" ValidateRequest="false" %>

<asp:Content ID="ContextMenuContent" ContentPlaceHolderID="ContextMenu" runat="server">
	<asp:LinkButton ID="btnSave" runat="server" CssClass="Action BtSauvegarder" OnClick="btnSave_Click" Text="<%$ Resources : Medianamik_Global, SaveButtonText %>" />
	<a href="<%= ReturnURL %>" class="Action BtAnnuler"><%=Resources("Medianamik_Global", "Cancel") %></a>
</asp:Content>

<asp:Content ID="CenterContent" ContentPlaceHolderID="CenterContent" runat="server">

	<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy" runat="server">
		<AjaxSettings>
			<telerik:AjaxSetting AjaxControlID="btnSave" EventName="OnClick">
				<UpdatedControls>
					<telerik:AjaxUpdatedControl ControlID="uplForm" />
				</UpdatedControls>
			</telerik:AjaxSetting>
		</AjaxSettings>
	</telerik:RadAjaxManagerProxy>
	
	<asp:UpdatePanel ID="uplValidation" runat="server" UpdateMode="Always">
		<ContentTemplate>
	        <asp:ValidationSummary ID="valSummary" EnableClientScript="false" runat="server" CssClass="ValidationSummary" />
        </ContentTemplate>
    </asp:UpdatePanel><br />

    <telerik:RadTabStrip id="RadTabStrip1" MultiPageID="RadMultiPage1"
       runat="server" Skin="Medianamik" EnableEmbeddedSkins="false" CausesValidation="false" ShowBaseLine="True">
       <Tabs>
           <telerik:RadTab Text="Propriété" PageViewID="Property" Selected="true" />
           <telerik:RadTab Text="Restrictions" PageViewID="Restrictions" />
       </Tabs>
    </telerik:RadTabStrip>
    
    <telerik:RadMultiPage id="RadMultiPage1" SelectedIndex="0" Runat="server" CssClass="TabPage">
        <telerik:RadPageView id="Property" runat="server" CssClass="ContainerEditeurPage">
	        <asp:UpdatePanel ID="uplForm" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional">
		        <ContentTemplate>
			        <table cellpadding="0" cellspacing="0" border="0" Width="100%">
                        <tr>
                            <td width="50%" valign="top">
				                <label class="EditionPage"><%=Resources("Medianamik_TypeManagement", "PropertyName") %><span class="ChampObligatoire">*</span><asp:RequiredFieldValidator EnableClientScript="false" ID="reqPropertyName" runat="server" ControlToValidate="txtPropertyName" ErrorMessage="<%$ Resources : Medianamik_TypeManagement, PropertyNameRequired %>" Display="None" /><asp:RegularExpressionValidator EnableClientScript="false" ID="regPropertyName" runat="server" ControlToValidate="txtPropertyName" Text="Ce champ n'est pas valide." ErrorMessage="<%$ Resources : Medianamik_TypeManagement, PropertyNameIsInvalid %>" Display="None" ValidationExpression="^[A-Z][a-zA-Z]*$" /><asp:CustomValidator ID="valPropertyName" runat="server" EnableClientScript="false" ControlToValidate="txtPropertyName" ErrorMessage="<%$ Resources : Medianamik_TypeManagement, PropertyNameMustBeUnique %>" OnServerValidate="valPropertyName_ServerValidate" /></label>
				                <p><asp:TextBox ID="txtPropertyName" runat="server" CssClass="TxtBox" MaxLength="50" /></p><br />
				                <label class="EditionPage"><%=Resources("Medianamik_TypeManagement", "Description") %></label>
				                <p><asp:TextBox CssClass="TxtArea" runat="server" ID="txtPropertyDescription" TextMode="MultiLine" /></p><br />
				                <p><asp:CheckBox ID="chkHaveTooltip" runat="server" AutoPostBack="true" OnCheckedChanged="chkHaveTooltip_CheckedChanged" Text="<%$ Resources: Medianamik_TypeManagement, PropertyManagement_tooltipCheckBox %>" /></p>
				                <asp:Panel ID="panTooltip" runat="server" Visible="false">
				                <med:TranslatorBox id="txtTooltipBox" runat="server" Label="<%$ Resources : Medianamik_TypeManagement, Tooltip %>" />
				                </asp:Panel><br />
				                <med:TranslatorBox ID="txtTranslatorBox" runat="server" Label="<%$ Resources : Medianamik_TypeManagement, Label %>" Required="true" ErrorMessage="<%$ Resources : Medianamik_TypeManagement, LabelIsRequired %>" /><br />
				                <label class="EditionPage"><asp:Literal runat="server" Text="<%$ Resources: Medianamik_TypeManagement, GroupName %>" /></label>
				                <p><asp:TextBox ID="txtGroupName" runat="server" CssClass="TxtBox" MaxLength="50" /></p><br />
				                <toolkit:AutoCompleteExtender runat="server" ID="aceGroupName" TargetControlID="txtGroupName" ServicePath="/Medianamik/Services/TypeManagementService.asmx" ServiceMethod="GetPropertyGroupNames" MinimumPrefixLength="2" CompletionInterval="1000" EnableCaching="true" CompletionSetCount="20" CompletionListCssClass="autocomplete_completionListElement" CompletionListItemCssClass="autocomplete_listItem" CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem" DelimiterCharacters=";, :" />
				                <p><asp:CheckBox ID="chkIsLookup" AutoPostBack="true" OnCheckedChanged="chkIsLookup_CheckedChanged" runat="server" Text="Is Lookup" /></p>
			                </td>
                            <td><img src="/medianamik/images/spacer.gif" width="16" height="1" /></td>
                            <td width="50%" valign="top">
				                <asp:PlaceHolder ID="phrDataTypeFields" runat="server">
					                <label class="EditionPage"><%=Resources("Medianamik_TypeManagement", "DataType") %><span class="ChampObligatoire">*</span><asp:RequiredFieldValidator EnableClientScript="false" ID="reqDataType" runat="server" ControlToValidate="ddlDataTypes" ErrorMessage="<%$ Resources : Medianamik_TypeManagement, DataTypeRequired %>" Display="None" /></label>
					                <p><asp:DropDownList ID="ddlDataTypes" runat="server" AutoPostBack="true" DataValueField="ID" DataTextField="SQLDataTypeName" OnSelectedIndexChanged="ddlDataTypes_SelectedIndexChanged" CssClass="SelectList" TabIndex="11" /></p><br />
					                <asp:PlaceHolder ID="phrSpecialLength" runat="server" Visible="false">
						                <label class="EditionPage"><%=Resources("Medianamik_TypeManagement", "Length") %><asp:RegularExpressionValidator EnableClientScript="false" ID="regLength" runat="server" ControlToValidate="txtLength" ErrorMessage="<%$ Resources : Medianamik_TypeManagement, LengthIsInvalid %>" Display="None" ValidationExpression="^[1-9][0-9]?[0-9]?[0-9]?$" /></label>
						                <p><asp:TextBox ID="txtLength" runat="server" CssClass="TxtBox" MaxLength="4" /></p><br />
					                </asp:PlaceHolder>
				                </asp:PlaceHolder>
				                <asp:PlaceHolder ID="phrLanguageNeutral" runat="server">
					                <p><asp:CheckBox ID="chkIsLanguageNeutral" runat="server" Text="Is Language Neutral" /></p>
				                </asp:PlaceHolder>
				                <asp:PlaceHolder ID="phrIndexation" runat="server" Visible="false">
					                <p><asp:CheckBox ID="chkIndexable" runat="server" Checked="true" Text="La valeur est indexée" /></p><br />
				                </asp:PlaceHolder>
				                <asp:PlaceHolder ID="phrMedianamikControl" runat="server" Visible="false">
					                <label class="EditionPage"><%=Resources("Medianamik_TypeManagement", "MedianamikControl") %></label>
					                <p><asp:DropDownList ID="ddlMedianamikControls" runat="server" AutoPostBack="true" DataValueField="ID" DataTextField="Name" OnSelectedIndexChanged="ddlMedianamikControls_SelectedIndexChanged" CssClass="SelectList" TabIndex="11" /></p>
					                <asp:PlaceHolder ID="phrMedianamikControlFields" runat="server" Visible="false">
						                <asp:PlaceHolder ID="phrMedianamikControlWidth" runat="server" Visible="false">
						                    <med:TextBoxDefaultValueExtender ID="extMedianamikControlWidth" runat="server" TargetControlID="txtMedianamikControlWidth" />
							                <label class="EditionPage"><%=Resources("Medianamik_TypeManagement", "MedianamikControlWidth") %> <asp:RegularExpressionValidator EnableClientScript="false" ID="regMedianamikControlWidth" runat="server" ControlToValidate="txtMedianamikControlWidth" ErrorMessage="<%$ Resources : Medianamik_TypeManagement, WidthIsInvalid %>" Display="None" ValidationExpression="^[1-9][0-9]?[0-9]?[0-9]?(pt|pica|px|m|cm|mm|um|in|ft|yd|%)?$" /></label>
							                <p><asp:TextBox ID="txtMedianamikControlWidth" runat="server" CssClass="TxtBox" TabIndex="12" MaxLength="10" /></p><br />
						                </asp:PlaceHolder>
						                <asp:PlaceHolder ID="phrMedianamikControlHeigth" runat="server" Visible="false">
						                    <med:TextBoxDefaultValueExtender ID="extMedianamikControlHeigth" runat="server" TargetControlID="txtMedianamikControlHeigth" />
							                <label class="EditionPage"><%=Resources("Medianamik_TypeManagement", "MedianamikControlHeight") %> <asp:RegularExpressionValidator EnableClientScript="false" ID="regMedianamikControlHeigth" runat="server" ControlToValidate="txtMedianamikControlHeigth" ErrorMessage="<%$ Resources : Medianamik_TypeManagement, HeightIsInvalid %>" Display="None" ValidationExpression="^[1-9][0-9]?[0-9]?[0-9]?$" /></label>
							                <p><asp:TextBox ID="txtMedianamikControlHeigth" runat="server" CssClass="TxtBox" TabIndex="13" MaxLength="4" /></p><br />
						                </asp:PlaceHolder>
						                <asp:PlaceHolder ID="phrUnique" runat="server" Visible="false">
							                <p><asp:CheckBox ID="chkIsUnique" runat="server" Text="<%$ Resources : Medianamik_TypeManagement, MustBeUnique %>" /></p><br />
						                </asp:PlaceHolder>
						                <asp:PlaceHolder ID="phrRequired" runat="server" Visible="false">
							                <p><asp:CheckBox ID="chkRequired" runat="server" Text="<%$ Resources : Medianamik_TypeManagement, IsRequired %>" /></p><br />
						                </asp:PlaceHolder>
						                <asp:PlaceHolder ID="phrValidationExpression" runat="server" Visible="false">
							                <label class="EditionPage"><%=Resources("Medianamik_TypeManagement", "ValidationRegex") %><asp:CustomValidator ID="valValidationExpression" runat="server" EnableClientScript="false" ControlToValidate="txtValidationExpression" ErrorMessage="<%$ Resources : Medianamik_TypeManagement, ValidationRegexIsInvalid %>" OnServerValidate="valValidationExpression_ServerValidate" /></label>
							                <p><asp:TextBox ID="txtValidationExpression" runat="server" CssClass="TxtBox" /></p><br />
						                </asp:PlaceHolder>
						                <asp:PlaceHolder ID="phrLength" runat="server" Visible="false">
							                <label class="EditionPage"><%=Resources("Medianamik_TypeManagement", "MaxLength") %><asp:RegularExpressionValidator EnableClientScript="false" ID="regMaxLength" runat="server" ControlToValidate="txtMaxLength" ErrorMessage="<%$ Resources : Medianamik_TypeManagement, MaxLengthIsInvalid %>" Display="None" ValidationExpression="^[1-9][0-9]?[0-9]?[0-9]?$" /></label>
							                <p><asp:TextBox ID="txtMaxLength" runat="server" CssClass="TxtBox" MaxLength="4" /></p><br />
							                <label class="EditionPage"><%=Resources("Medianamik_TypeManagement", "MinLength") %><asp:RegularExpressionValidator EnableClientScript="false" ID="regMinLength" runat="server" ControlToValidate="txtMinLength" ErrorMessage="<%$ Resources : Medianamik_TypeManagement, MinLengthIsInvalid %>" Display="None" ValidationExpression="^[1-9][0-9]?[0-9]?[0-9]?$" /></label>
							                <p><asp:TextBox ID="txtMinLength" runat="server" CssClass="TxtBox" MaxLength="4" /></p><br />
						                </asp:PlaceHolder>
					                </asp:PlaceHolder>
				                </asp:PlaceHolder>
				                <asp:PlaceHolder ID="phrLookupType" runat="server" Visible="false">
					                <label class="EditionPage"><%=Resources("Medianamik_TypeManagement", "LookupType") %><span class="ChampObligatoire">*</span><asp:RequiredFieldValidator EnableClientScript="false" ID="reqLookupTypes" runat="server" ControlToValidate="ddlLookupTypes" ErrorMessage="<%$ Resources : Medianamik_TypeManagement, LookupTypeRequired %>" Display="None" /></label>
					                <p><asp:DropDownList ID="ddlLookupTypes" runat="server" AutoPostBack="true" DataValueField="ID" DataTextField="Name" OnSelectedIndexChanged="ddlLookupTypes_SelectedIndexChanged" CssClass="SelectList" /></p>
					                <asp:PlaceHolder ID="phrLookupFields" runat="server" Visible="false">
						                <label class="EditionPage"><%=Resources("Medianamik_TypeManagement", "LookupProperty") %><span class="ChampObligatoire">*</span><asp:RequiredFieldValidator EnableClientScript="false" ID="reqLookupProperties" runat="server" ControlToValidate="ddlLookupProperties" ErrorMessage="<%$ Resources : Medianamik_TypeManagement, LookupPropertyRequired %>" Display="None" /></label>
						                <p><asp:DropDownList ID="ddlLookupProperties" runat="server" DataValueField="ID" DataTextField="Name" CssClass="SelectList" /></p><br />
					                </asp:PlaceHolder>
				                </asp:PlaceHolder>
				                <%--On ne peut pas chacher ce contrôle car la javascript doit être rendu dès le premier chargement --%>
                                <label class="EditionPage"><%=Resources("Medianamik_TypeManagement", "TreeRoot") %></label>
                                <p><med:NodeComboTree  ID="RootNodeIdComboBox" runat="server" Width="300" Height="400" /></p>
                            </td>
                        </tr>
                    </table>
		        </ContentTemplate>
	        </asp:UpdatePanel>
	    </telerik:RadPageView>
        <telerik:RadPageView id="Restrictions" runat="server" CssClass="ContainerEditeurPage">
                <label class="EditionPage"><%=Resources("Medianamik_TypeManagement", "EditionRoles") %></label>
                <p><med:RoleCheckBoxList ID="cblRoles" runat="server" RepeatLayout="Flow" RepeatDirection="vertical" /></p>
        </telerik:RadPageView>
	</telerik:RadMultiPage>
	
	<p><span class="ChampObligatoire">*</span><%=Resources("Medianamik_Global", "RequiredField") %></p>
</asp:Content>
